Skip to main content

What is Password Generator?

Password Generator is a full-featured password generation solution that demonstrates enterprise-grade backend logic, API integration, and modern frontend architecture. The project provides three distinct implementations:
  • Python Package: Installable library for programmatic password generation
  • Console Application: Command-line interface for quick password generation
  • Full-Stack Web Application: React/Next.js frontend with Django REST API backend
All generated passwords follow a secure format combining uppercase letters, lowercase letters, numbers, and special characters to maximize entropy.

Key Features

Secure Password Generation

Generates 10-character passwords with mixed case, numbers, and special characters using multiple randomization passes for enhanced security

User Authentication

JWT-based authentication system with registration, login, and profile management

Password Management

Save, update, and delete passwords with associated metadata (site name, URL) for authenticated users

Multiple Deployment Options

Use as a Python library, console tool, or full web application with REST API

Architecture Overview

Core Password Generation Logic

The password generation algorithm uses an Object-Oriented Programming approach with three main components:
  1. list_elements Class: Manages character pools (numbers, letters, special characters)
  2. password_generator Function: Combines elements from multiple pools to create candidate passwords
  3. password Function: Orchestrates the generation process with randomized parameters
The algorithm generates 50 candidate passwords in each run, ensuring uniqueness, then randomly selects one to return. This multi-pass approach significantly increases entropy.
def password_generator(list_num: list, list_str: list, list_char: list):
    passwords = []
    for i in range(50):
        password = f"{random.choice(list_char)}{random.choice(list_num)}{random.choice(list_str)}{random.choice(list_char)}{random.choice(list_str).upper()}{random.choice(list_str)}{random.choice(list_num)}{random.choice(list_str)}{random.choice(list_str)}{random.choice(list_char)}"
        if password not in passwords:
            passwords.append(password)
    chosen = random.choice(passwords)
    return chosen

Web Application Architecture

The web application follows a modern full-stack architecture: Frontend Stack
  • React.js with Next.js 14+ (App Router)
  • Tailwind CSS for styling
  • NextUI component library
  • Axios for API communication
  • Context API for authentication state
Backend Stack
  • Django 4+ with Django REST Framework
  • SimpleJWT for token-based authentication
  • PostgreSQL/SQLite database
  • CORS headers for cross-origin requests
API Architecture
1

Password Generation Endpoint

GET /api/response-password/ - Public endpoint that calls the core Python password generation logic
2

Authentication Endpoints

  • POST /api/sign-up/ - User registration
  • POST /api/sign-in/ - User login with JWT token response
3

Password Management Endpoints (Protected)

  • POST /api/save-password/ - Save password with metadata
  • GET /api/view-passwords/ - Retrieve user’s saved passwords
  • PUT /api/update-password/{id}/ - Update saved password
  • DELETE /api/delete-password/{id}/ - Delete saved password

Data Models

The application uses two primary models:
from django.contrib.auth.models import AbstractUser

class Users(AbstractUser):
    email = models.EmailField(max_length=200, unique=True)
    first_name = models.CharField(max_length=200, blank=True, default='')
    last_name = models.CharField(max_length=200, blank=True, default='')
    number_phone = models.CharField(max_length=10, blank=True, null=True)
    avatar = models.ImageField(upload_to='avatars/', blank=True, null=True)
    
    REQUIRED_FIELDS = ['email']

Who Should Use This?

Developers

Integrate secure password generation into applications using the Python package

System Administrators

Use the console version for quick password generation in scripts and automation

End Users

Access the web application for generating and managing passwords with a user-friendly interface
This project is designed as a learning and demonstration tool. For production password management, consider additional security measures like encryption at rest, secure key storage, and regular security audits.

Password Format

Generated passwords follow this structure:
  • Length: 10 characters
  • Composition: Special character + number + lowercase + special character + uppercase + lowercase + number + lowercase + lowercase + special character
  • Character Sets:
    • Numbers: 0-9
    • Letters: a-z (uppercase and lowercase)
    • Special characters: ! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ ] ^ _ { | } ~ ¡ ¿ ° € and backtick
Each password generation creates 50 unique candidates before randomly selecting one, ensuring high entropy and unpredictability.

Next Steps

Quickstart Guide

Get started with Password Generator in minutes

API Reference

Explore the complete API documentation